#pragma once
#ifndef _BUFFER_H_
#define _BUFFER_H_
#include <string>
#include <sys/types.h>

class Buffer
{
private:
	std::string buf;
public:
	Buffer();
	~Buffer();
	void append(const char* _str, int _size);
	long int size();
	const char* c_str();
	std::string& getBuf();
	void clear();
	void getline();
};


#include <vector>

class ReceiveBuffer {
public:
	ReceiveBuffer(std::size_t bufferSize) : buffer(bufferSize) {}

	void append(const char* data, std::size_t dataSize) {
		for (std::size_t i = 0; i < dataSize; ++i) {
			buffer.push_back(data[i]);
		}
	}

	void clear() {
		buffer.clear();
	}

	std::size_t size() const {
		return buffer.size();
	}

	const std::vector<char>& getData() const {
		return buffer;
	}

private:
	std::vector<char> buffer;
};

#endif